#include <bits/stdc++.h>
using namespace std;

const int R=,M=998244353;
using ll=long long;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	freopen("plant.in","r",stdin);
	freopen("plant.out","w",stdout);
	int t,id,n,m,c,f;
	cin>>t>>id;
	if(id==1) {
		cout<<"0 0\n";
		return 0;
	}
	if(id>=2&&id<=4) {
		while(t--) {
			cin>>n>>m>>c>>f;
		}
	}
	if(id==5||id==6) {
	}
	cout<<0;
	return 0;
}
